/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.ac.iie.di.ban.ycl.ybk.e2p.yb.tools;

/**
 *
 * @author Administrator
 */
public class Test {

    public static void main(String[] args) {
//        String lcHalfPath = "./images/123134815696ef1c9bf1f1c9c96ef1c9.jpg";
//        lcHalfPath = lcHalfPath.substring(lcHalfPath.indexOf("/") + 1, lcHalfPath.length());
//        System.out.println(lcHalfPath);

//        String str = "{\n"
//                + "  \"count\": 1,\n"
//                + "  \"uploadUser\": \"\",\n"
//                + "  \"uploadTime\": \"20160101000000\",\n"
//                + "  \"protocol\": \"1.2\",\n"
//                + "  \"dataType\": \"orderInfo\",\n"
//                + "  \"record_list\": [\n"
//                + "    {\n"
//                + "      \"orderNo\": \"hyn_指令编码1\",\n"
//                + "      \"orderSource\": \"指令来源1\",\n"
//                + "      \"orderLevel\": \"指令等级1\",\n"
//                + "      \"orderTitle\": \"指令标题1\",\n"
//                + "      \"orderContent\": \"指令内容1\",\n"
//                + "      \"orderType\": \"指令类型1\",\n"
//                + "      \"mainExternalClass\": \"hyn_一级分类1\",\n"
//                + "      \"secondExternalClass\": \"hyn_二级分类1\",\n"
//                + "      \"externalEventName\": \"hyn_事件1\",\n"
//                + "      \"receiver\": \"下发对象1\",\n"
//                + "      \"handleTime\": \"20161223121212\",\n"
//                + "      \"upstreamSystemCode\": \"105\",\n"
//                + "      \"upstreamSystemName\": \"九宫格系统\",\n"
//                + "      \"businessBureau\": \"处置业务局1\",\n"
//                + "      \"businessDataAuthGroup\": \"处置数据权限组1\",\n"
//                + "      \"businessUserGroup\": \"处置用户组1\",\n"
//                + "      \"businessUserCode\": \"处置用户编码1\",\n"
//                + "      \"orderSampleList\": [\n"
//                + "        {\n"
//                + "          \"sampleName\": \"hyn_样本_test1\",\n"
//                + "          \"sampleAlias\": \"样本\",\n"
//                + "          \"sampleDescription\": \"样本\",\n"
//                + "          \"sampleContent\": \"样本\",\n"
//                + "          \"typeName\": \"SP\",\n"
//                + "          \"fileMd5\": \"sadfasdf2342312345678901qwertyty\",\n"
//                + "          \"fileExt\": \"mp4\",\n"
//                + "          \"fileSize\": 123123,\n"
//                + "          \"language\": \"汉语\",\n"
//                + "          \"sourceSiteName\": \"优酷\",\n"
//                + "          \"sourceSiteProduct\": \"优酷视频\",\n"
//                + "          \"sourceSiteUrl\": \"hyn_http://www.baidu.com\",\n"
//                + "          \"sourceTypeName\": \"后台导入\",\n"
//                + "          \"upstreamSystemCode\": \"105\",\n"
//                + "          \"upstreamSystemName\": \"九宫格系统\",\n"
//                + "          \"sourceSystemCode\": \"104\",\n"
//                + "          \"level\": 1,\n"
//                + "          \"importance\": 2,\n"
//                + "          \"sampleTimes\": \"10:06\",\n"
//                + "          \"publishTime\": \"20160102000000\",\n"
//                + "          \"crawlTime\": \"20160103000000\",\n"
//                + "          \"fileId\": \"123123\",\n"
//                + "          \"upLoadIp\": \"1.1.1.1\",\n"
//                + "          \"ipLocation\": \"河北省石家庄\",\n"
//                + "          \"icpIp\": \"4.3.2.1\",\n"
//                + "          \"icpIpLocation\": \"北京市海淀区\",\n"
//                + "          \"summary\": \"1234sdfgvdsfgdfgdf火影忍者\",\n"
//                + "          \"keywords\": [\n"
//                + "            \"XX21\",\n"
//                + "            \"X似的发射点X123\"\n"
//                + "          ],\n"
//                + "          \"tagNames\": null,\n"
//                + "          \"eventName\": \"hyn_G201\",\n"
//                + "          \"eventKeywords\": [\n"
//                + "            \"hyn_G2011\",\n"
//                + "            \"hyn_G2022\"\n"
//                + "          ],\n"
//                + "          \"mainExternalClass\": \"hyn_mainClass5\",\n"
//                + "          \"secondExternalClass\": \"hyn_secondClass6\",\n"
//                + "          \"reportType\": \"新闻\",\n"
//                + "          \"handleType\": \"全网清查\",\n"
//                + "          \"handleState\": 1,\n"
//                + "          \"fileUrl\": \"/ybkdata/yb/SP/20161227/146daf56ea760ae01f2ddd704da0421d/146daf56ea760ae01f2ddd704da0421d.mp4\",\n"
//                + "          \"fileShowUrl\": \"/ybkdata/yb/SP/20161227/146daf56ea760ae01f2ddd704da0421d/146daf56ea760ae01f2ddd704da0421d.mp4\",\n"
//                + "          \"mmsFileUrl\": \"\",\n"
//                + "          \"mmsFileShowUrl\": \"\",\n"
//                + "          \"businessBureau\": \"业务局\",\n"
//                + "          \"businessDataAuthGroup\": \"数据权限组\",\n"
//                + "          \"businessUserGroup\": \"用户组\",\n"
//                + "          \"businessUserCode\": \"用户编码\",\n"
//                + "          \"isPackaged\": false,\n"
//                + "          \"containFile\": false,\n"
//                + "          \"attachmentList\": [\n"
//                + "            {\n"
//                + "              \"fileName\": \"123134815696ef1c9bf1f1c9c96ef1c9.jpg\",\n"
//                + "              \"originalFileName\": \"12313.jpg\",\n"
//                + "              \"relativePath\": \"./images/123134815696ef1c9bf1f1c9c96ef1c9.jpg\",\n"
//                + "              \"fullPath\": \"http://youku/8888/images/12313.jpg\",\n"
//                + "              \"resType\": 1,\n"
//                + "              \"fileMd5\": \"123134815696ef1c9bf1f1c9c96ef1c9\"\n"
//                + "            }\n"
//                + "          ]\n"
//                + "        }\n"
//                + "      ],\n"
//                + "      \"attachmentList\": [\n"
//                + "        {\n"
//                + "          \"fileName\": \"123134815696ef1c9bf1f1c9c96ef1c9.jpg\",\n"
//                + "          \"originalFileName\": \"12313.jpg\",\n"
//                + "          \"relativePath\": \"./images/123134815696ef1c9bf1f1c9c96ef1c9.jpg\",\n"
//                + "          \"fullPath\": \"http://youku/8888/images/12313.jpg\",\n"
//                + "          \"resType\": 1,\n"
//                + "          \"fileMd5\": \"123134815696ef1c9bf1f1c9c96ef1c9\"\n"
//                + "        }\n"
//                + "      ]\n"
//                + "    }\n"
//                + "  ]\n"
//                + "}";
//        
//        String str1 = "{\"count\":1,\"uploadTime\":\"2016-11-18 17:17:00\",\"protocol\":\"DTP-S-1.1\",\"record_list\":[{\"website\":{\"remark\":[{\"remarkIp\":null,\"remarkTime\":null,\"remarkCont\":null,\"remarkUser\":null}],\"clickNum\":null,\"download\":[{\"dwdUser\":null,\"dwdTime\":null,\"dwdIp\":null}],\"isOffline\":false,\"remarkNum\":null,\"uploadTime\":\"20161118171702\",\"discoverTime\":null,\"offlineTime\":null,\"praisedNum\":null,\"dwdNum\":null,\"trampledNum\":null},\"ipLocation\":null,\"icpip\":null,\"sourceSiteUrl\":\"http://blog.sina.com.cn/s/blog_7579f6940102xdww.html\",\"sampleName\":\"32944533\",\"sampleSecondSort\":null,\"icpipLocation\":\"北京\",\"sampleDescription\":\"学习小感\",\"fileMd5\":\"c92ba62ebbe4447b0e0b1f40779b282e\",\"fileExt\":\"html\",\"typeName\":\"BLOG\",\"tag\":[],\"fileSize\":\"31890\",\"sourceProduct\":\"新浪博客\",\"keywords\":\"习\",\"sampleTimes\":null,\"createTime\":\"2016-11-18 00:33:21\",\"fileShowUrl\":\"/ybkdata/yb/BLOG/20161118/c92ba62ebbe4447b0e0b1f40779b282e/c92ba62ebbe4447b0e0b1f40779b282e.html\",\"sampleAlias\":null,\"language\":\"汉语\",\"level\":\"0\",\"containFile\":true,\"user\":{\"userName\":null,\"idType\":null,\"userEmail\":null,\"province\":null,\"userState\":null,\"city\":null,\"country\":null,\"userId\":null,\"userNickName\":null,\"nation\":null,\"processingTime\":null,\"userQq\":null,\"idNum\":null,\"birthday\":null,\"userPhone\":null,\"sex\":null,\"ipAddress\":null,\"userWeChat\":null,\"userConfirmEmail\":null},\"attachmentList\":[],\"sourceSystem\":\"2\",\"summary\":\"时间过得真快，转眼间，十天的学习生活就过去了。我们又得像来时...\",\"sampleMainSort\":\"涉领导人\",\"sourceName\":null,\"sourceTypeName\":\"后台传入\",\"isPackaged\":false,\"ip\":\"10.136.64.48\",\"fileIcon\":null,\"fileUrl\":\"/ybkdata/yb/BLOG/20161118/c92ba62ebbe4447b0e0b1f40779b282e/c92ba62ebbe4447b0e0b1f40779b282e.html\",\"fileId\":null,\"crawlTime\":\"2016-11-18 00:33:21\"}]";
//
//        JSONObject ob = null;
//        try {
//            ob = JSONObject.fromObject(str1);
//        } catch (Exception e) {
//        }
//        JSONArray dataArray = ob.getJSONArray("record_list");
//
//        for (int i = 0; i < dataArray.size(); i++) {
//            JSONObject jsonObject = dataArray.getJSONObject(i);
//            String dataType = jsonObject.get("typeName").toString();
//            System.out.println(dataType);
//        }
//        String orclFilePath = "D:/maven/.m2/repository/cn/ac/iie/multimedia/iie.jar";
//
//        String mediaPath = "";
//        ClientAPI client = new ClientAPI();
//        String uri = "STL://192.168.239.170:26379;192.168.239.171:26379";
//        try {
//            client.init(uri, "YBK");
//            mediaPath = client.uploadFile(orclFilePath);
//        } catch (Exception e) {
//            e.printStackTrace();
//        } finally {
//            client.quit();
//        }
//        System.out.println(mediaPath);
        
    }
}
